package com.study.mike.model.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.study.mike.model.entity.SaleOrderProduct;
import com.study.mike.model.entity.SaleProduct;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author KangHui
 * @Date 2022/8/30 9:17
 */
@Data
public class AddOrderPO {
    /**
     * 订单号
     */
    @NotNull(message = "订单号不能为空")
    private String orderSn;

    /**
     * 订单状态
     */
    private Integer status;

    /**
     * 订单金额
     */
    private BigDecimal orderAccount;

    /**
     * 下单时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime payTime;

    /**
     * 订单商品
     */
    @Valid
    private List<SaleOrderProductPO> saleOrderProducts;

}
